/*!
 * \file GapEventConnectionInd.h
 * \brief Event carrying message GapConnectInd
 */

#ifndef SGW_GAP_EVENT_CONNECTION_IND_H
#define SGW_GAP_EVENT_CONNECTION_IND_H

#include "EventData.h"
#include "GapGlobals.h"
#include "GAP.pb.h"

namespace tsc
{
namespace sgw
{

using GatewayApplicationPart::GapConnectInd;
using ProtocolsCommon::IpAddress;

/**
 * The first event which is handled by GapGenerator after being created.
 * It carries received GapConnectInd message
 */
class GapEventConnectionInd : public common::EventData
{
public:

    GapEventConnectionInd(GapConnectInd& connInd, unsigned int socketConnId) :
		EventData(GAP_CONNECTION_IND),
		mpMgwIpAddress(0),
		mSocketConnId(socketConnId)
	{
        mpMgwIpAddress = new IpAddress(connInd.mgwaddress());
	}

	virtual ~GapEventConnectionInd()
	{
		delete mpMgwIpAddress;
	}

	IpAddress* getMgwIpAddress() const
	{
		return mpMgwIpAddress;
	}

	unsigned int getSocketConnId() const
    {
        return mSocketConnId;
    }

private:
	IpAddress*   mpMgwIpAddress;
	unsigned int mSocketConnId;
};

} // namespace sgw
} // namespace tsc

#endif // SGW_GAP_EVENT_CONNECTION_IND_H
